package com.xqh.javabasic.arrayelement_index_query; 

public class ArrayElement_Index_Query{
	
	public static int arrayElement_Index_Query(int [] arr, int element){
		
		int x = 0;
		while(x < arr.length){
			
			if(arr [x] == element){
				return x;
				
			}	
			
			x++;
		}
			
		return -1;
}



public static void main (String [] args){
	
	int [] a = {50,2,-9,7};
	
	int index = arrayElement_Index_Query(a,70);
	
	System.out.println(index);
	}
}